    <script src="/scripts/calnder/jscal2.js"></script>
    <script src="/scripts/calnder/en.js"></script>
    <link rel="stylesheet" type="text/css" href="/scripts/calnder/jscal2.css" />
    <link rel="stylesheet" type="text/css" href="/scripts/calnder/border-radius.css" />
    <link rel="stylesheet" type="text/css" href="/scripts/calnder/steel.css" />
    <style type="text/css">
      .highlight { color: #f00 !important; }
      .highlight2 { color: #0f0 !important; font-weight: bold; }
    </style>

<link rel="stylesheet" type="text/css" media="screen" href="/scripts/nicedit_files/screen.css" />
<link rel="stylesheet" href="/styles/thickbox.css" />
<script type="text/javascript" src="/scripts/thickbox.js"></script>
<div id="blockContIn">
<table border="0" cellspacing="0" cellpadding="0" align="left">
  <tr>
    <td valign="top"><div class="Col">
		<tal:block tal:content="structure php: this.partial('myactivity/myactivity.html')"/>
</div></td>
	<td valign="top" width="100%"><div class="ColExp">
<div class="ModuleBlock">
<h1>
<?php if($ctx->startDate!='' && isset($ctx->getJournals['result'][0]['added_date'])) { 
	$displayDate = ' -'. date($ctx->date_fromat,strtotime($ctx->getJournals['result'][0]['added_date']));
} else { 
	$displayDate = '';
	} ?>
<label class="fontBigTitle">Journals <?php echo $displayDate;?></label>

<div class="wid186"><input type="text" name="serValue" id="serValue" value="search" onfocus="clearField(this.id,'search');" onblur="addValuetoField(this.id,'search');" /><a href="javascript:void(0);" onclick="showSearchSection();"><img src="/images/ModSearchIcon.png" border="0" class="SerImg" /></a></div>
</h1>
<div class="clear"></div>
<div>
<ul class="JModuleMenu" >
<li><a href="/journals/index/favorites">Favourites</a> </li>
<li><a href="/journals/index/journals" class="active">Activity</a> </li>
</ul>
<div class="clear"></div>
</div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td width="45%" valign="top" id="taskEdit">
    <tal:block tal:content="structure php: this.partial('/index/create-journals.html')"/>
	</td>
    <td width="10%"><img src="/images/JournalSepBg.gif" /></td>
	<td width="45%" valign="top" class="CurvBg" id="listContent">
	<tal:block tal:content="structure php: this.partial('/index/journals-list.html')"/>
	</td>
  </tr>
</table>


</div>

<div class="clear"></div>
</div>
</div></td>
<td valign="top">
<div class="ColBanner">
<div class="ModuleBlock">
<div align="center">
    <form>
      <table width="100">
        <tr>
          <td colspan="4" id="cont"></td>
        </tr>
      </table>
    </form>
</div>
<a href="javascrpt:void(0);" onclick="getCal();">Check </a>
<img src="/images/Gads.gif" /><img src="/images/Gads.gif" /></div>
</div></td>	
  </tr>
</table>





<div class="clear"></div>
</div>
<div class="clear"></div>



<script type="text/javascript">
//<![CDATA[

function journalSettings()
{
	tb_show('Journals Settings','/journals/index/journals-settings?&height=400&width=600','');
}
function getCal()
{	
	
}
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
	pagination = new Array();
	pagination['currentPage'] = "<?=$ctx->getJournals['currentPage']?>";
	pagination['resultsPerPage'] = "<?=$ctx->getJournals['resultPerPage']?>";
	pagination['pages'] = "<?= $ctx->getJournals['pages']?>";  
	pagination['pager'] = '<?=$ctx->getJournals["pager"]?>';
	pagination['resultsCount'] = "${getJournals/resultsCount}" ;
	
	var Params='${params}';
	//alert(pagination['resultsCount']+'  '+Params);
	var requestUrl = "/journals/index/pagination/<?php echo $ctx->startDate;?>/";
	$(document).ready(function () {
	   setPagination(pagination['resultsCount'],'topPagerId','downPagerId','','');
	});
	
function editJournal(editedId,defDate)
{
		$.ajax({
		type: "POST",
		dataType: "json",
		data: {id:editedId,date:defDate},
		url: "/journals/index/edit",
		success: function(data){
			$('#taskEdit').html(data.output);
		}
		});

}
//]]>
</script>
<script type="text/javascript">			
function showSearchSection(){
	serVale = $('#serValue').val();
	//alert(serVale);
	ajaxPager(1,serVale);
}
</script>
    <script type="text/javascript">//<![CDATA[

      // this handler is designed to work both for onSelect and onTimeChange
      // events.  It updates the input fields according to what's selected in
      // the calendar.
      function updateFields(cal) {
              var date = cal.selection.get();
			  //alert(date);
              if (date) {
                      date = Calendar.intToDate(date);
					  var dateValue = Calendar.printDate(date, "%m-%d-%Y");
					  //alert(dateValue);return false;
                      window.location = "/journals/index/journals/"+dateValue;
              }
              //document.getElementById("f_hour").value = cal.getHours();
             // document.getElementById("f_minute").value = cal.getMinutes();
      };

      Calendar.setup({
			//var dateValue = Calendar.printDate(date, "%m-%d-%Y");
              cont         : "cont",
              onSelect     : updateFields,
			  date          : <?php echo $ctx->hilight;?>,
			  selection	   : <?php echo $ctx->hilight;?>
      });
 function clearField(id,itemvalue)
{
	if($("#"+id).val()==itemvalue){
		$("#"+id).val('');
	}
}
function addValuetoField(id,itemvalue)
{
	if($("#"+id).val()==''){
		$("#"+id).val(itemvalue);
	}
}
function deleteJournal(id,current_page,start_date)
{
	//alert(id+"and"+action);return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "id="+id+"&current_page="+current_page+"&date="+start_date,
			    url: "/journals/index/delete-journal/",
			    success: function(data){
					$('#listContent').html(data.output);
									
				}
			});
}

    //]]></script>